// Framework: None
// Technology stack: None

#include <iostream>
#include <vector>
#include <string>
#include <regex>
#include <algorithm>

int main() {
    std::vector<std::string> words;
    std::string input;

    std::cout << "Enter words separated by spaces:";
    std::getline(std::cin, input);

    std::istringstream iss(input);
    std::string word;
    while (iss >> word) {
        words.push_back(word);
    }

    if (words.size() < 2) {
        std::cout << "Too few words for analysis" << std::endl;
    } else {
        int wordCount = words.size();
        int cyrillicCount = 0;
        int latinCount = 0;
        int shortWordCount = 0;
        int hyphenCount = 0;

        for (const std::string& word : words) {
            if (std::regex_search(word[0], std::regex("[А-Я]"))) {
                cyrillicCount++;
            }
            if (std::regex_search(word, std::regex("[a-zA-Z]"))) {
                latinCount++;
            }
            if (word.length() <= 3) {
                shortWordCount++;
            }
            if (word.find('-') != std::string::npos) {
                hyphenCount++;
            }
        }

        std::string longestWord = *std::max_element(words.begin(), words.end(), 
            [](const std::string& a, const std::string& b) { return a.length() < b.length(); });

        std::cout << "Word count: " << wordCount << std::endl;
        std::cout << "Words starting with a capital Cyrillic letter: " << cyrillicCount << std::endl;
        std::cout << "Words containing a Latin character: " << latinCount << std::endl;
        std::cout << "Words not exceeding 3 characters: " << shortWordCount << std::endl;
        std::cout << "Words containing a hyphen: " << hyphenCount << std::endl << std::endl;
        std::cout << "Longest word: " << longestWord << std::endl;
        std::cout << "Length of the word: " << longestWord.length() << std::endl;
    }

    return 0;
}